<template>
  <div class="app-container">
    <el-card>
      <div class="account-settings-info-main" :class="device">
        <div class="account-settings-info-left">
          <el-menu
            router
            mode="horizontal"
            :default-openeds="openKeys"
          >
            <el-menu-item key="/system/account/security">
              <router-link :to="{ name: 'BaseSettings' }">
                基本设置
              </router-link>
            </el-menu-item>
            <el-menu-item key="/account/settings/security">
              <router-link :to="{ name: 'SecuritySettings' }">
                安全设置
              </router-link>
            </el-menu-item>
          </el-menu>
        </div>
        <div class="account-settings-info-right">
          <div class="account-settings-info-title">
            <span>{{ $route.meta.title }}</span>
          </div>
          <route-view />
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>

export default {
  data() {
    return {
      selectedKeys: []

    }
  },
  watch: {
    '$route'(val) {
      this.updateMenu()
    }
  },
  created() {
    this.updateMenu()
  },
  methods: {
    onOpenChange() {

    },
    updateMenu() {
      const routes = this.$route.matched.concat()
      this.openKeys = [routes.pop().path]
    }
  }
}
</script>

<style lang="scss" scoped>
.account-settings-info-main {
  width: 100%;
  display: flex;
  height: 100%;
  overflow: auto;

  &.mobile {
    display: block;

    .account-settings-info-left {
      border-right: unset;
      border-bottom: 1px solid #e8e8e8;
      width: 100%;
      height: 50px;
      overflow-x: auto;
      overflow-y: scroll;
    }
    .account-settings-info-right {
      padding: 20px 40px;
    }
  }

  .account-settings-info-left {
    border-right: 1px solid #e8e8e8;
    width: 224px;
  }

  .account-settings-info-right {
    flex: 1 1;
    padding: 8px 40px;

    .account-settings-info-title {
      color: rgba(0,0,0,.85);
      font-size: 20px;
      font-weight: 500;
      line-height: 28px;
      margin-bottom: 12px;
    }
    .account-settings-info-view {
      padding-top: 12px;
    }
  }
}

</style>
